package cn.wolfcode.trip.base.domain;

import com.alibaba.druid.support.json.JSONUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.HashMap;
import java.util.List;

/*
 * 攻略的分类*/
@ToString
@Getter
@Setter
@JsonIgnoreProperties(value = {"handler", "json"}) //转成json数据时不需要序列化handler属性
public class StrategyCatalog extends BaseDomain {
    // 名称
    private String name;
    //所属攻略
    private Strategy strategy;
    // 序号
    private Integer sequence;
    //状态
    private Boolean state = true;

    private List<StrategyDetail> details;

    public String getJson() {
        HashMap<String, Object> map = new HashMap();
        map.put("id", id);
        map.put("name", name);
        map.put("strategyId", strategy.getId());
        map.put("sequence", sequence);
        map.put("state", state);
        return JSONUtils.toJSONString(map);
    }

}